package com.ruoyi.btlfbreed.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.btlfbreed.mapper.TbVaccinationRecordsMapper;
import com.ruoyi.btlfbreed.domain.TbVaccinationRecords;
import com.ruoyi.btlfbreed.service.ITbVaccinationRecordsService;

/**
 * 疫苗使用登记Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-07
 */
@Service
public class TbVaccinationRecordsServiceImpl implements ITbVaccinationRecordsService 
{
    @Autowired
    private TbVaccinationRecordsMapper tbVaccinationRecordsMapper;

    /**
     * 查询疫苗使用登记
     * 
     * @param recordId 疫苗使用登记主键
     * @return 疫苗使用登记
     */
    @Override
    public TbVaccinationRecords selectTbVaccinationRecordsByRecordId(Long recordId)
    {
        return tbVaccinationRecordsMapper.selectTbVaccinationRecordsByRecordId(recordId);
    }

    /**
     * 查询疫苗使用登记列表
     * 
     * @param tbVaccinationRecords 疫苗使用登记
     * @return 疫苗使用登记
     */
    @Override
    public List<TbVaccinationRecords> selectTbVaccinationRecordsList(TbVaccinationRecords tbVaccinationRecords)
    {
        return tbVaccinationRecordsMapper.selectTbVaccinationRecordsList(tbVaccinationRecords);
    }

    /**
     * 新增疫苗使用登记
     * 
     * @param tbVaccinationRecords 疫苗使用登记
     * @return 结果
     */
    @Override
    public int insertTbVaccinationRecords(TbVaccinationRecords tbVaccinationRecords)
    {
        tbVaccinationRecords.setCreateTime(DateUtils.getNowDate());
        return tbVaccinationRecordsMapper.insertTbVaccinationRecords(tbVaccinationRecords);
    }

    /**
     * 修改疫苗使用登记
     * 
     * @param tbVaccinationRecords 疫苗使用登记
     * @return 结果
     */
    @Override
    public int updateTbVaccinationRecords(TbVaccinationRecords tbVaccinationRecords)
    {
        tbVaccinationRecords.setUpdateTime(DateUtils.getNowDate());
        return tbVaccinationRecordsMapper.updateTbVaccinationRecords(tbVaccinationRecords);
    }

    /**
     * 批量删除疫苗使用登记
     * 
     * @param recordIds 需要删除的疫苗使用登记主键
     * @return 结果
     */
    @Override
    public int deleteTbVaccinationRecordsByRecordIds(Long[] recordIds)
    {
        return tbVaccinationRecordsMapper.deleteTbVaccinationRecordsByRecordIds(recordIds);
    }

    /**
     * 删除疫苗使用登记信息
     * 
     * @param recordId 疫苗使用登记主键
     * @return 结果
     */
    @Override
    public int deleteTbVaccinationRecordsByRecordId(Long recordId)
    {
        return tbVaccinationRecordsMapper.deleteTbVaccinationRecordsByRecordId(recordId);
    }
}
